home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- TMP=/var/log/setup/tmp
- T_PX=`cat $TMP/SeTT_PX`
- ROOT_DEVICE=`cat $TMP/SeTrootdev`
- export TEXTDOMAIN=SeTbootloader
-
- # A function to ask for append= parameters.
- ask_append(){
- dialog --title "`gettext -e "OPTIONAL LILO append=<kernel perameters> LINE"`" --no-cancel --inputbox \
- "`gettext -e "Some systems might require extra parameters to be passed to the kernel. \
- If you needed to pass parameters to the kernel when you booted the Kate \
- bootdisk, you'll probably want to enter the same ones here. Most \
- systems won't require any extra parameters. If you don't need any, just \
- hit ENTER to continue.\n\
- \n"`" 13 72 2> $TMP/reply
- RETVAL=$?
- return $RETVAL
- }
-
-
-
- if test ! -f $T_PX/sbin/lilo ; then
- dialog --title "LILO NOT FOUND" --msgbox "LILO was not found on your system ! \
- You should always remember to install lilo package ! Your Kate OS system will not \
- boot without bootloader !" 10 72
- exit
- fi
-
- dialog --title "`gettext "SELECT LILO TARGET LOCATION"`" $DEFAULT --menu "`gettext "LILO can be installed \
- to a variety of places: the master boot record of your first hard drive, \
- the superblock of your root Linux partition (which could then be made the \
- bootable partition with fdisk), a formatted floppy disk, \
- or the master boot record of your first hard drive. If you're using \
- a boot system such as Boot Manager, you should use the 'Root' \
- selection. Please pick a target location:"`" 16 65 3 \
- "Root" "`gettext "Install to superblock (not for use with XFS)"`" \
- "Floppy" "`gettext "Use a formatted floppy disk in the boot drive"`" \
- "MBR" "`gettext "Use the Master Boot Record"`" \
- 2> $TMP/reply
- if [ $? = 1 -o $? = 255 ]; then
- exit
- fi
- TG="`cat $TMP/reply`"
- rm -r $TMP/reply
-
- if [ "$TG" = "`gettext "MBR"`" ]; then
- LILO_TARGET=`cat $TMP/SeTrootdev | cut -c 1-8`
- fi
-
- if [ "$TG" = "`gettext "Root"`" ]; then
- LILO_TARGET=`cat $TMP/SeTrootdev`
- fi
-
- if [ "$TG" = "`gettext "Floppy"`" ]; then
- LILO_TARGET="/dev/fd0"
- fi
- while [ 1 ] ; do
- dialog --title "`gettext "CONFIRM LOCATION TO INSTALL LILO"`" --no-cancel --inputbox \
- "`gettext "The auto-detected location to install the LILO boot block is shown below. \
- If you need to make any changes, you can make them below. Otherwise, hit \
- ENTER to accept the target location shown."`" 11 60 $LILO_TARGET 2> $TMP/reply
- if [ $? = 0 ]; then
- LILO_TARGET="`cat $TMP/reply`"
- if [ -b $LILO_TARGET ] ; then
- break
- else
- LILO_TARGET=""
- dialog --title "`gettext "ERROR"`" --msgbox \
- "`gettext "Selected device doesn't exist ! TRY AGAIN"`" 6 40
- rm -rf $TMP/reply
- fi
- fi
- done
-
- CONSOLENUM=791
-
-
- ask_append;
- if [ $? = 1 -o $? = 255 ]; then
- unset APPEND
- fi
- APPEND="`cat $TMP/reply`"
-
- cat << EOF > $T_PX/etc/lilo.conf
- # LILO configuration file
- #
- # Start LILO global section
- EOF
-
- if [ ! "$APPEND" = "" ]; then
- echo "append=\"$APPEND\"" >> $T_PX/etc/lilo.conf
- fi
-
- echo "boot = $LILO_TARGET" >> $T_PX/etc/lilo.conf
- echo "`cat $T_PX/boot/kateoslogo.dat`" >> $T_PX/etc/lilo.conf
-
- cat << EOF >> $T_PX/etc/lilo.conf
- prompt
- timeout = 1200
- # Override dangerous defaults that rewrite the partition table:
- change-rules
- reset
- EOF
-
- cat << EOF >> $T_PX/etc/lilo.conf
- # End LILO global section
- # Linux root partition section
- image = /boot/vmlinuz
- root = $ROOT_DEVICE
- label = KateOS
- initrd = /boot/initrd
- vga=791
- append="$APPEND splash=silent quiet"
- read-only
-
- image = /boot/vmlinuz
- root = $ROOT_DEVICE
- label = KateOS_verbose
- initrd = /boot/initrd
- vga=791
- append="$APPEND splash=off"
- read-only
-
- image = /boot/vmlinuz
- root = $ROOT_DEVICE
- label = KateOS_failsafe
- initrd = /boot/initrd
- vga=normal
- append="$APPEND splash=off ide=nodma noapic noapm acpi=off noudev"
- read-only
-
- # End root Linux partition section
- EOF
-
-
-
- WINDEVICE="/dev/hda1 /dev/hda2 /dev/hdb1 /dev/hdb2 /dev/hdc1 /dev/hdc2 /dev/hdd1 \
- /dev/hdd2 /dev/hde1 /dev/hde2 /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 \
- /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 /dev/sdf1 /dev/sdf2"
- mkdir $TMP/windev
- for device in $WINDEVICE ; do
- mount $device $TMP/windev 1>/dev/null 2>/dev/null
- if [ -d $TMP/windev/windows ] && [ -f $TMP/windev/windows/notepad.exe ] ; then
- TABLE="`echo $device | cut -c 1-8`"
- cat << EOF >> $T_PX/etc/lilo.conf
- # Windows bootable partition config begins
- other = $device
- label = Windows
- table = $TABLE
- # Windows bootable partition config ends
- EOF
-
- fi
- umount $TMP/windev 1>/dev/null 2>/dev/null
- done
- rm -rf $TMP/windev
-
- cat << EOF > $T_PX/boot/boot_message.txt
-
- Welcome to the LILO Boot Loader!
-
- EOF
-
- chroot $T_PX mount /proc 1>/dev/null 2>/dev/null
- chroot $T_PX lilo -m /boot/map -C /etc/lilo.conf 1>/dev/null 2>/dev/null
- SUCCESS=$?
- chroot $T_PX umount /proc 1>/dev/null 2>/dev/null
- if [ ! "$SUCCESS" = "0" ]; then # some LILO error occured
- dialog --title "`gettext "LILO INSTALL ERROR #"`$SUCCESS" --msgbox \
- "`gettext "Sorry, but the attempt to install LILO has returned an error, so LILO \
- has not been correctly installed. You'll have to use a bootdisk \
- to start your \
- machine instead. It should still be possible to get LILO working by \
- editing the /etc/lilo.conf and reinstalling LILO manually. See the \
- LILO man page and documentation in /usr/doc/lilo/ for more help."`" 11 60
- else
- dialog --title "`gettext "LILO INSTALLED SUCCESFULLY"`" --msgbox \
- "`gettext "Your bootloader was installed successfully."`" 0 0
-
- fi
-